import http from "@/utils/http";

/**
 * 注册
 * @param {*} data
 * @returns
 */
export const registerAPI = data => {
  var params = new URLSearchParams();
  for (let key in data) {
    params.append(key, data[key]);
  }
  return http.post("/user/register", params);
};

/**
 * 登录
 * @param {*} data
 * @returns
 */
export const loginAPI = data => {
  var params = new URLSearchParams();
  for (let key in data) {
    params.append(key, data[key]);
  }
  return http.post("/user/login", params);
};
